<#--
    -ObjectMap
    -------------------------
    -OBJECT_CODE
    -OBJECT_CODE_UPPERCASE
    -OBJECT_CODE_LOWERCASE
    -OBJECT_CODE_BEAN_PATTERN
    -OBJECT_CODE_CAMLE_CASE

    -ObjectMap.attributesList
    -----------------------------------------
    -ATTRIBUTE_CODE
    -ATTRIBUTE_CODE_UPPERCASE
    -ATTRIBUTE_CODE_LOWERCASE
    -ATTRIBUTE_CODE_BEAN_PATTERN
    -ATTRIBUTE_CODE_CAMEL_CASE

    -ATTRIBUTE_CODE_DATATYPE
    -ATTRIBUTE_IS_PRIMARY_KEY
    -ATTRIBUTE_IS_FOREIGN_KEY
    

  
 -->

@NamedQuery(name = "HesUsers.findByUserName",
query = "SELECT h FROM HesUsers h 
WHERE
<#assign argument = "">
<#assign i = 0>
<#list ObjectMap.attributesList   as  myList>
    <#if myList.FILTER_BY = "true">
        h.${myList.ATTRIBUTE_CODE_BEAN_PATTERN} = :${myList.ATTRIBUTE_CODE_BEAN_PATTERN} <#if i+1 != attributesList?size><#assign argument = argument + " AND "></#if>
    </#if>
<#assign i = i + 1>
</#list>
")